package com.clcg;

import com.lcg.TestService;

import java.lang.reflect.Proxy;

/**
 * 作者: LCG
 * 日期: 2020/8/4 17:35
 * 描述:
 */
public class TestInterfaceProxy<T> {

    public T getInterfaceProxy( String host,int port,String impl){

        TestInvocation testInvocation=new TestInvocation(host,port,impl);

        Class<?>[] clazz={TestService.class};

        T o = (T)Proxy.newProxyInstance(TestService.class.getClassLoader(), clazz, testInvocation);

        return o;

    }

}
